<!DOCTYPE HTML>
<html>
<head>
    {include file="common:meta"}
    <style>
        .txt-left{
            text-align: left;
            text-indent: 10px;
        }
    </style>
</head>
<body>
<div class="page-container">
    <div class="ibox float-e-margins">
        <div class="ibox-content">

            <div>
                <ul class="nav nav-tabs">
                    <li class="active" id="recive"><a data-toggle="tab" href="#tab-1" aria-expanded="true">收到的礼物</a>
                    </li>
                    <li class="active" id="send"><a data-toggle="tab" href="#tab-2" aria-expanded="false">送出的礼物</a>
                    </li>
                </ul>
                <div class="tab-content">
                    <div class=" tab-pane active" id="tab-1">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th colspan="5">收到的礼物</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <th>礼物名字</th>
                                <th >礼物图片</th>
                                <th>礼物数量</th>
                                <th>获得的钻石</th>
                                <th>获得的金币</th>
                            </tr>
                            {volist name="userData.giftData" id="gift"}
                            <tr>

                                <td>{$gift.gift_name}</td>
                                <td><img src="{$gift.gift_pic}" style="width: 10%;"/></td>
                                <td>{$gift.allnum}</td>
                                <td>{$gift.alldiamonds}</td>
                                <td>{$gift.allgold}</td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                        {$userData.giftData|raw}
                    </div>
                    <div class=" tab-pane active" id="tab-2">
                        <table class="table table-striped table-bordered table-hover dataTables-example">
                            <thead>
                            <tr>
                                <th colspan="5">送出的礼物</th>
                            </tr>
                            </thead>
                            <tbody>

                            <tr>
                                <th >礼物名称</th>
                                <th >图片</th>
                                <th>数量</th>
                                <th>总金币</th>
                                <th>总钻石</th>
                            </tr>
                            {volist name="userData.sendGiftData" id="gift"}
                            <tr>

                                <td>{$gift.gift_name}</td>
                                <td><img src="{$gift.gift_pic}" style="width: 10%;"/></td>
                                <td>{$gift.allnum}</td>
                                <td>{$gift.allgold}</td>
                                <td>{$gift.alldiamonds}</td>
                                <input type="hidden" class="display-type" value="{$gift.type}">
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                        {$userData.sendGiftData|raw}
                    </div>
                </div>
            </div>
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th colspan="6">用户基本信息</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td colspan="2">用户头像</td>
                    <td class="txt-left" colspan="4"><img src="{$userData.userInfo.head_portrait}" width="10%"></td>
                </tr>
                <tr>
                    <td colspan="2">用户ID</td>
                    <td class="txt-left" colspan="4" id="u_number">{$userData.userInfo.u_number}</td>
                </tr>
                <tr>
                    <td colspan="2">用户名</td>
                    <td class="txt-left" colspan="4">{$userData.userInfo.nickname}</td>
                </tr>
                <tr>
                    <td colspan="2">签名</td>
                    <td class="txt-left" colspan="4">{$userData.userInfo.signature}</td>
                </tr>
                <tr>
                    <td colspan="2">性别</td>
                    <td class="txt-left" colspan="4">{$userData.userInfo.sex}</td>
                </tr>
                <tr>
                    <td colspan="2">生日</td>
                    <td class="txt-left" colspan="4">{$userData.userInfo.birthday}</td>
                </tr>
                <tr>
                    <td colspan="2">RMB</td>
                    <td class="txt-left" colspan="4">&yen;{$userData.userInfo.money}</td>
                </tr>

                <tr>
                    <td colspan="2">钻石</td>
                    <td class="txt-left" colspan="4">{$userData.userInfo.diamonds}</td>
                </tr>
                <tr>
                    <td colspan="2">金币</td>
                    <td class="txt-left" colspan="4">{$userData.userInfo.gold}</td>
                </tr>
                <tr>
                    <td colspan="2">魅力值&等级</td>
                    <td class="txt-left" colspan="4">{$userData.userInfo.charm_value} & {$userData.userInfo.charm_level}</td>
                </tr>
                <tr>
                    <td colspan="2">财富值&等级</td>
                    <td class="txt-left" colspan="4">{$userData.userInfo.wealth_value} & {$userData.userInfo.wealth_level}</td>
                </tr>
                <tr>
                    <td colspan="2">关注人数</td>
                    <td class="txt-left" colspan="4">{$userData.userInfo.follow_num}</td>
                </tr>
                <tr>
                    <td colspan="2">粉丝人数</td>
                    <td class="txt-left" colspan="4">{$userData.userInfo.fans_num}</td>
                </tr>
                <tr>
                    <td colspan="2">绑定支付宝账号</td>
                    <td class="txt-left" colspan="4">{$userData.userInfo.alipay}</td>
                </tr>
                <tr>
                    <td colspan="2">绑定支付宝姓名</td>
                    <td class="txt-left" colspan="4">{$userData.userInfo.alipay_name}</td>
                </tr>
                <tr>
                    <td colspan="2">累计充值RMB金额（钻石）</td>
                    <td class="txt-left" colspan="4">&yen;{$userData.userInfo.recharge_money}（{$userData.userInfo.recharge_diamonds}）
                        <button class=" btn btn-primary btn-sm recharge-detail"  style="margin-left: 10px;">明细</button>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">累计消费钻石</td>
                    <td class="txt-left" colspan="4">{$userData.userInfo.cost_diamonds}(充值总钻石 - 当前剩余钻石)(仅供参考)</td>
                </tr>
                <tr>
                    <td colspan="2">累计提现（礼物）/（推荐）</td>
                    <td class="txt-left" colspan="4">&yen;{$userData.userInfo.Withdrawal_amount} / &yen;{$userData.userInfo.introduce_amount}
                        <button class=" btn btn-primary btn-sm  withdraw-detail"  style="margin-left: 10px;">明细</button>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">累计兑换RMB/钻石</td>
                    <td class="txt-left" colspan="4">&yen;{$userData.userInfo.exchange_money} / {$userData.userInfo.exchange_diamonds}
                        <button class=" btn btn-primary btn-sm exchange-detail"  style="margin-left: 10px;">明细</button>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">最近登录时间</td>
                    <td class="txt-left" colspan="4">{$userData.userInfo.last_login}</td>
                </tr>
                <tr>
                    <td colspan="2">账号状态</td>
                    <td class="txt-left" colspan="4">
                        {if $userData.userInfo.status == 1 }在线
                        {else /}离线
                        {/if}
                        </td>
                </tr>
                <tr>
                    <td colspan="2">礼物记录</td>
                    <td class="txt-left" colspan="4">
                        <button class=" btn btn-primary btn-sm receive-gift-detail"  style="margin-left: 10px;">收到的礼物明细</button>
                        <button class=" btn btn-primary btn-sm send-gift-detail"  style="margin-left: 10px;">送出的礼物明细</button>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
<input type="hidden"  id="user_id"  value="{$userData.userInfo.id}">
{include file="common:footer"}
<script>
    //判断显示收到的礼物和送出的礼物
    $(document).ready(function () {
        var display_type = $('.display-type').val();

        if(!display_type) display_type = 2;

        console.log(display_type);
        if(display_type == 2){
            $('#tab-2').removeClass('active');
            $('#send').removeClass('active');
        }
        if(display_type == 1){
            $('#tab-1').removeClass('active');
            $('#recive').removeClass('active');
        }
    });

    var user_id = $('#user_id').attr('value');
    var u_id = $('#u_number').html();
    //充值明细
    $('.recharge-detail').click(function(){
        layer.open({
            type: 2,
            title: ['用户'+u_id+'的充值记录','font-size:18px;font-family:宋体;font-weight:700;'],
            shadeClose: true,
            shade: false,
            maxmin: true, //开启最大化最小化按钮
            area: ['800px', '500px'],
            content:"/RechargeInfo?user_id=" + user_id,
            offset:'auto',
            scrollbar:false
        });
//        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
//        parent.layer.close(index);
    });
    //兑换明细

    $('.exchange-detail').click(function(){
        layer.open({
            type: 2,
            title: ['用户'+u_id+'的兑换记录','font-size:18px;font-family:宋体;font-weight:700;'],
            shadeClose: true,
            shade: false,
            maxmin: true, //开启最大化最小化按钮
            area: ['800px', '500px'],
            content:"/ExchangeDetail?user_id=" + user_id,
            offset:'auto',
            scrollbar:false
        });
    });

    //提现明细

    $('.withdraw-detail').click(function(){
        layer.open({
            type: 2,
            title: ['用户'+u_id+'的提现记录','font-size:18px;font-family:宋体;font-weight:700;'],
            shadeClose: true,
            shade: false,
            maxmin: true, //开启最大化最小化按钮
            area: ['800px', '500px'],
            content:"/WithdrawDetail?user_id=" + user_id,
            offset:'auto',
            scrollbar:false
        });
    });

    //收到的礼物详情
    $('.receive-gift-detail').click(function(){
        layer.open({
            type: 2,
            title: ['用户'+u_id+'收到的礼物详情','font-size:18px;font-family:宋体;font-weight:700;'],
            shadeClose: true,
            shade: false,
            maxmin: true, //开启最大化最小化按钮
            area: ['800px', '500px'],
            content:"/ReceiveGiftDetail?user_id=" + user_id,
            offset:'auto',
            scrollbar:false
        });
    });

    //送出的礼物详情
    $('.send-gift-detail').click(function(){
        layer.open({
            type: 2,
            title: ['用户'+u_id+'送出的礼物详情','font-size:18px;font-family:宋体;font-weight:700;'],
            shadeClose: true,
            shade: false,
            maxmin: true, //开启最大化最小化按钮
            area: ['800px', '500px'],
            content:"/SendGiftDetail?user_id=" + user_id,
            offset:'auto',
            scrollbar:false
        });
    });

</script>
</body>
</html>